<?php
header('Content-type: application/json');
require_once("LastFMService.php");
$lastFM = new LastFMService();

switch($_GET['op'])
{
	case "userGet":
		echo $lastFM->getUserByName($_GET['username']);
		break;

	case "userFriends":
		echo $lastFM->getFriendsByUser($_GET['username'], $_GET['limit']);
		break;
	
	case "userArtist":
		echo $lastFM->getArtistsByUser($_GET['username'], $_GET['limit']);
		break;

	case "artistAlbums":
		echo $lastFM->getTopAlbumsByArtist($_GET['artistName'], $_GET['id']);
		break;

	case "compareTaste":
		echo $lastFM->compareUserTaste($_GET["user1"], $_GET["user2"], $_GET["limit"]);
		break;
}

exit;
?>